package com.itheima.mall.service.sms;

import com.itheima.mall.api.sms.HomeAdvertiseServiceApi;
import com.itheima.mall.pojo.sms.SmsHomeAdvertise;
import com.itheima.mall.vo.PageResult;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class HomeAdvertiseService {
    @DubboReference
    HomeAdvertiseServiceApi advertiseServiceApi;
    public void createAdvertise(SmsHomeAdvertise smsHomeAdvertise) {
        advertiseServiceApi.createAdvertise(smsHomeAdvertise);
    }

    public void deleteAdvertise(int[] ids) {
        advertiseServiceApi.deleteAdvtertise(ids);
    }

    public PageResult<SmsHomeAdvertise> getList(String endTime, String name, Integer pageNum, Integer pageSize, Integer type) {
        PageResult<SmsHomeAdvertise> list = advertiseServiceApi.getList(endTime, name, pageNum, pageSize, type);
        return list;
    }

    public void updateStatus(Integer id, Integer status) {
        advertiseServiceApi.updateStatus(id,status);
    }

    public void updateAdvertise(SmsHomeAdvertise smsHomeAdvertise) {
        advertiseServiceApi.updateAdvertise(smsHomeAdvertise);
    }

    public SmsHomeAdvertise getAdvertise(Integer id) {
        SmsHomeAdvertise advertise = advertiseServiceApi.getAdvertise(id);
        return advertise;
    }
}
